package top.fengyulou.qmy.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service;
import top.fengyulou.common.Jr;
import top.fengyulou.common.UserUtils;
import top.fengyulou.qmy.dao.ProjectDao;
import top.fengyulou.qmy.dao.UserDao;
import top.fengyulou.qmy.entity.ProjectForm;
import top.fengyulou.qmy.entity.UserForm;

import javax.annotation.Resource;
import java.util.List;

@Service
@Slf4j
public class ProjectService {

    @Resource
    private ProjectDao projectDao;

    public void insert(ProjectForm form){
        projectDao.insert(form);
    }

    public PageInfo getPageList(ProjectForm form){
        PageHelper.startPage(form.getPageNum(), form.getPageSize());
        List<ProjectForm> list = projectDao.getList();
        return new PageInfo<>(list);
    }

    public ProjectForm getById(Long id){
        return projectDao.getById(id);
    }

    public void update(ProjectForm form) {
        projectDao.update(form);
    }

    public void delete(Long id) {
        projectDao.delete(id);
    }
}
